
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>JDK源码分析HashMap · tgor note</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="tgor">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Java注解.html" />
    
    
    <link rel="prev" href="ArrayList源码分析.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Me
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../category/微服务.html">
            
                <a href="../category/微服务.html">
            
                    
                    微服务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Java-Spring/Feign.html">
            
                <a href="../Java-Spring/Feign.html">
            
                    
                    HTTP客户端Feign
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Java-其他库/限流.html">
            
                <a href="../Java-其他库/限流.html">
            
                    
                    限流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../运维/Nginx限流.html">
            
                <a href="../运维/Nginx限流.html">
            
                    
                    限流Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../Java-Spring/负载均衡.html">
            
                <a href="../Java-Spring/负载均衡.html">
            
                    
                    负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../运维/Nginx负载均衡.html">
            
                <a href="../运维/Nginx负载均衡.html">
            
                    
                    负载均衡Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../Java-其他库/熔断Hystrix.html">
            
                <a href="../Java-其他库/熔断Hystrix.html">
            
                    
                    熔断Hystrix
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../Java-其他库/缓存.html">
            
                <a href="../Java-其他库/缓存.html">
            
                    
                    缓存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../Java-其他库/缓存.html">
            
                <a href="../Java-其他库/缓存.html#本地缓存">
            
                    
                    本地缓存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html">
            
                    
                    分布式缓存Redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="../Java-其他库/分布式事务.html">
            
                <a href="../Java-其他库/分布式事务.html">
            
                    
                    分布式事务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.11" data-path="../Java-其他库/分布式事务.html">
            
                <a href="../Java-其他库/分布式事务.html#事务消息">
            
                    
                    可靠事务消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.12" data-path="../Java-Spring/业务监控.html">
            
                <a href="../Java-Spring/业务监控.html">
            
                    
                    业务监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.13" data-path="../Java-其他库/分布式定时作业.html">
            
                <a href="../Java-其他库/分布式定时作业.html">
            
                    
                    分布式作业调度ElasticJob
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.14" data-path="../Java-ORM/ORM.html">
            
                <a href="../Java-ORM/ORM.html">
            
                    
                    ORM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.15" data-path="../Java-其他库/分布式系统及CAP原理.html">
            
                <a href="../Java-其他库/分布式系统及CAP原理.html">
            
                    
                    分布式系统及CAP原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.16" data-path="../MQ/RabbitMQ笔记.html">
            
                <a href="../MQ/RabbitMQ笔记.html">
            
                    
                    消息驱动Rabbitmq
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../category/数据库.html">
            
                <a href="../category/数据库.html">
            
                    
                    数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Mysql/经典数据库设计案例.html">
            
                <a href="../Mysql/经典数据库设计案例.html">
            
                    
                    mysql设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Mysql/Mysql事务与锁.html">
            
                <a href="../Mysql/Mysql事务与锁.html">
            
                    
                    mysql事务与锁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../Mysql/mysql数据类型.html">
            
                <a href="../Mysql/mysql数据类型.html">
            
                    
                    mysql数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../Mysql/mysql索引及查询.html">
            
                <a href="../Mysql/mysql索引及查询.html">
            
                    
                    mysql索引与查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../Mysql/mysql索引及查询.html">
            
                <a href="../Mysql/mysql索引及查询.html#查询语句设计准则">
            
                    
                    mysql查询语句设计准则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../Mysql/mysql性能测试.html">
            
                <a href="../Mysql/mysql性能测试.html">
            
                    
                    mysql性能测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../Mysql/mysql主从同步与读写分离.html">
            
                <a href="../Mysql/mysql主从同步与读写分离.html">
            
                    
                    mysql主从同步与读写分离
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../Java-Spring/SpringBoot事务注解@Transactional.html">
            
                <a href="../Java-Spring/SpringBoot事务注解@Transactional.html">
            
                    
                    Spring事务注解@Transactional
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../数据结构与算法/位运算应用实例.html">
            
                <a href="../数据结构与算法/位运算应用实例.html">
            
                    
                    位运算应用实例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../Mongodb-Client/morphia-API汇总.html">
            
                <a href="../Mongodb-Client/morphia-API汇总.html">
            
                    
                    morphia API汇总
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../Mongodb-Client/mongo驱动连接.html">
            
                <a href="../Mongodb-Client/mongo驱动连接.html">
            
                    
                    mongodb驱动与连接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="../Mongodb/mongodb-ObjectId实践.html">
            
                <a href="../Mongodb/mongodb-ObjectId实践.html">
            
                    
                    mongodb ObjectId实践
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="../Mongodb/mongodb角色权限.html">
            
                <a href="../Mongodb/mongodb角色权限.html">
            
                    
                    mongodb角色权限
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../category/java并发.html">
            
                <a href="../category/java并发.html">
            
                    
                    Java并发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="Java并发.html">
            
                <a href="Java并发.html">
            
                    
                    Java并发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="Java并发.html">
            
                <a href="Java并发.html#锁">
            
                    
                    Java并发之锁设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="Java并发.html">
            
                <a href="Java并发.html#synchronized">
            
                    
                    Java并发之synchronized
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="Java之Lock.html">
            
                <a href="Java之Lock.html#reentrantlock">
            
                    
                    Java Lock之ReentrantLock
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="Java之Lock.html">
            
                <a href="Java之Lock.html#reentrantreadwritelock">
            
                    
                    Java Lock之ReentrantReadWriteLock
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="Java之Future.html">
            
                <a href="Java之Future.html">
            
                    
                    Java Future
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="Java之Future.html">
            
                <a href="Java之Future.html#futuretask">
            
                    
                    Java Future之FutureTask
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="Java之Future.html">
            
                <a href="Java之Future.html#completablefuture">
            
                    
                    Java Future之CompletableFuture
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="Java之Future.html">
            
                <a href="Java之Future.html#forkjointask">
            
                    
                    Java Future之ForkJoinTask
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="Java之Thread.html">
            
                <a href="Java之Thread.html">
            
                    
                    Java Thread
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../category/redis.html">
            
                <a href="../category/redis.html">
            
                    
                    Redis
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html">
            
                    
                    Redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#集群">
            
                    
                    Redis集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#消息订阅">
            
                    
                    Redis消息订阅
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#lua">
            
                    
                    Redis Lua脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#配置汇总">
            
                    
                    Redis配置汇总
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../category/运维.html">
            
                <a href="../category/运维.html">
            
                    
                    运维
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../运维/Linux常用操作汇总.html">
            
                <a href="../运维/Linux常用操作汇总.html">
            
                    
                    Linux常用操作汇总
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../运维/阿里云笔记.html">
            
                <a href="../运维/阿里云笔记.html">
            
                    
                    阿里云笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../category/nginx.html">
            
                <a href="../category/nginx.html">
            
                    
                    Nginx
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../运维/Nginx学习笔记.html">
            
                <a href="../运维/Nginx学习笔记.html">
            
                    
                    Nginx基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../运维/Nginx负载均衡.html">
            
                <a href="../运维/Nginx负载均衡.html">
            
                    
                    Nginx负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../运维/Nginx限流.html">
            
                <a href="../运维/Nginx限流.html">
            
                    
                    Nginx限流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../运维/Nginx学习笔记.html">
            
                <a href="../运维/Nginx学习笔记.html#六、其他">
            
                    
                    Nginx客户端辅助技巧
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../category/容器化.html">
            
                <a href="../category/容器化.html">
            
                    
                    容器化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../Docker/docker笔记.html">
            
                <a href="../Docker/docker笔记.html">
            
                    
                    Docker学习笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../Docker/docker笔记.html">
            
                <a href="../Docker/docker笔记.html#基础操作">
            
                    
                    Docker基础操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../Docker/docker笔记.html">
            
                <a href="../Docker/docker笔记.html#dockerfile">
            
                    
                    DockerFile
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../category/Web.html">
            
                <a href="../category/Web.html">
            
                    
                    Web
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../运维/Http入坑Https笔记.html">
            
                <a href="../运维/Http入坑Https笔记.html">
            
                    
                    Http入坑Https笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../Web/阿里云OSS.html">
            
                <a href="../Web/阿里云OSS.html">
            
                    
                    OSS
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../category/java基础.html">
            
                <a href="../category/java基础.html">
            
                    
                    Java基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="Java基础.html">
            
                <a href="Java基础.html#jvm">
            
                    
                    JVM基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="Java基础.html">
            
                <a href="Java基础.html#语法糖">
            
                    
                    Java语法糖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="Java基础.html">
            
                <a href="Java基础.html#数据结构">
            
                    
                    Java数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="Java8函数式编程.html">
            
                <a href="Java8函数式编程.html">
            
                    
                    java8函数式编程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="ArrayList源码分析.html">
            
                <a href="ArrayList源码分析.html">
            
                    
                    JDK源码分析ArrayList
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.10.6" data-path="HashMap源码分析.html">
            
                <a href="HashMap源码分析.html">
            
                    
                    JDK源码分析HashMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" data-path="Java注解.html">
            
                <a href="Java注解.html">
            
                    
                    Java注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.8" data-path="Timsort排序算法.html">
            
                <a href="Timsort排序算法.html">
            
                    
                    Timsort排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.9" data-path="插入排序分析与Java实现.html">
            
                <a href="插入排序分析与Java实现.html">
            
                    
                    插入排序分析与Java实现
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../category/工具与规范.html">
            
                <a href="../category/工具与规范.html">
            
                    
                    工具与规范
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../工具/Maven使用技巧汇总.html">
            
                <a href="../工具/Maven使用技巧汇总.html">
            
                    
                    Maven使用技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../编码规范/Java编码规范.html">
            
                <a href="../编码规范/Java编码规范.html">
            
                    
                    Java编码规范
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../category/OLAP.html">
            
                <a href="../category/OLAP.html">
            
                    
                    OLAP
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../数据处理/storm学习笔记.html">
            
                <a href="../数据处理/storm学习笔记.html">
            
                    
                    流式计算Storm学习笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../category/数据运营.html">
            
                <a href="../category/数据运营.html">
            
                    
                    数据运营
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../数据运营/增长黑客数据运营.html">
            
                <a href="../数据运营/增长黑客数据运营.html">
            
                    
                    增长黑客-数据运营
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../category/前端技术栈.html">
            
                <a href="../category/前端技术栈.html">
            
                    
                    前端技术栈
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../前端/JavaScript设计模式.html">
            
                <a href="../前端/JavaScript设计模式.html">
            
                    
                    JavaScript设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../前端/html相对路径与绝对路径.html">
            
                <a href="../前端/html相对路径与绝对路径.html">
            
                    
                    Html相对路径与绝对路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../前端/微信小程序学习笔记.html">
            
                <a href="../前端/微信小程序学习笔记.html">
            
                    
                    微信小程序学习笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../category/个人.html">
            
                <a href="../category/个人.html">
            
                    
                    个人
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../个人/简历.html">
            
                <a href="../个人/简历.html">
            
                    
                    简历
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >JDK源码分析HashMap</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="hashmap&#x6E90;&#x7801;&#x5206;&#x6790;">HashMap&#x6E90;&#x7801;&#x5206;&#x6790;</h1>
<p>&#x6807;&#x7B7E;&#xFF08;&#x7A7A;&#x683C;&#x5206;&#x9694;&#xFF09;&#xFF1A; Java-Base</p>
<hr>
<p>HashMap&#x7684;&#x5E95;&#x5C42;&#x4E3B;&#x8981;&#x662F;&#x57FA;&#x4E8E;&#x6570;&#x7EC4;&#x548C;&#x94FE;&#x8868;&#x6765;&#x5B9E;&#x73B0;&#x7684;&#xFF0C;&#x5B83;&#x4E4B;&#x6240;&#x4EE5;&#x6709;&#x76F8;&#x5F53;&#x5FEB;&#x7684;&#x67E5;&#x8BE2;&#x901F;&#x5EA6;&#x4E3B;&#x8981;&#x662F;&#x56E0;&#x4E3A;&#x5B83;&#x662F;&#x901A;&#x8FC7;&#x8BA1;&#x7B97;&#x6563;&#x5217;&#x7801;&#x6765;&#x51B3;&#x5B9A;&#x5B58;&#x50A8;&#x7684;&#x4F4D;&#x7F6E;&#x3002;HashMap&#x4E2D;&#x4E3B;&#x8981;&#x662F;&#x901A;&#x8FC7;key&#x7684;hashCode&#x6765;&#x8BA1;&#x7B97;hash&#x503C;&#x7684;&#xFF0C;&#x53EA;&#x8981;hashCode&#x76F8;&#x540C;&#xFF0C;&#x8BA1;&#x7B97;&#x51FA;&#x6765;&#x7684;hash&#x503C;&#x5C31;&#x4E00;&#x6837;&#x3002;&#x5982;&#x679C;&#x5B58;&#x50A8;&#x7684;&#x5BF9;&#x8C61;&#x5BF9;&#x591A;&#x4E86;&#xFF0C;&#x5C31;&#x6709;&#x53EF;&#x80FD;&#x4E0D;&#x540C;&#x7684;&#x5BF9;&#x8C61;&#x6240;&#x7B97;&#x51FA;&#x6765;&#x7684;hash&#x503C;&#x662F;&#x76F8;&#x540C;&#x7684;&#xFF0C;&#x8FD9;&#x5C31;&#x51FA;&#x73B0;&#x4E86;&#x6240;&#x8C13;&#x7684;hash&#x51B2;&#x7A81;&#x3002;&#x5B66;&#x8FC7;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x540C;&#x5B66;&#x90FD;&#x77E5;&#x9053;&#xFF0C;&#x89E3;&#x51B3;hash&#x51B2;&#x7A81;&#x7684;&#x65B9;&#x6CD5;&#x6709;&#x5F88;&#x591A;&#xFF0C;HashMap&#x5E95;&#x5C42;&#x662F;&#x901A;&#x8FC7;&#x94FE;&#x8868;&#x6765;&#x89E3;&#x51B3;hash&#x51B2;&#x7A81;&#x7684;&#x3002;</p>
<h2 id="hashcode&#x4E0E;hash">HashCode&#x4E0E;Hash</h2>
<p>HashCode&#xFF1A;&#x8BA1;&#x7B97;&#x673A;&#x6563;&#x5217;&#x7801;
Hash&#xFF1A;&#x901A;&#x8FC7;&#x6563;&#x5217;&#x7801;&#x8BA1;&#x7B97;&#x83B7;&#x5F97;&#x7684;&#x6563;&#x5217;&#x503C;</p>
<h2 id="hash---&#x83B7;&#x53D6;&#x5BF9;&#x8C61;&#x6563;&#x5217;&#x7801;">Hash() --&#x83B7;&#x53D6;&#x5BF9;&#x8C61;&#x6563;&#x5217;&#x7801;</h2>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> <span class="hljs-keyword">int</span> <span class="hljs-title">hash</span><span class="hljs-params">(Object key)</span> </span>{
    <span class="hljs-keyword">int</span> h;
    <span class="hljs-keyword">return</span> (key == <span class="hljs-keyword">null</span>) ? <span class="hljs-number">0</span> : (h = key.hashCode()) ^ (h &gt;&gt;&gt; <span class="hljs-number">16</span>); 
}
</code></pre>
<h2 id="&#x8BA1;&#x7B97;table&#x4F4D;&#x7F6E;&#x7D22;&#x5F15;">&#x8BA1;&#x7B97;table&#x4F4D;&#x7F6E;&#x7D22;&#x5F15;</h2>
<pre><code class="lang-java"><span class="hljs-keyword">int</span> n = (tab = resize()).length;
Node&lt;K,V&gt; p  = tab[i = (n - <span class="hljs-number">1</span>) &amp; hash];
</code></pre>
<p>HashMap&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x53CA;HashCode&#x76F8;&#x7B49;&#x7684;&#x60C5;&#x51B5;&#x5E26;&#x6765;&#x7684;&#x95EE;&#x9898;&#x662F;&#xFF0C;&#x5982;&#x4F55;&#x5C06;&#x5177;&#x6709;&#x4E0D;&#x76F8;&#x540C;HashCode&#x7684;Key&#x5BF9;&#x8C61;&#xFF0C;&#x5747;&#x5300;&#x5730;&#x5206;&#x5E03;&#x5728;&#x6570;&#x7EC4;&#x4E2D;&#xFF0C;&#x540C;&#x65F6;&#x5C06;&#x76F8;&#x540C;HashCode&#x7684;Key&#xFF0C;&#x7EC4;&#x5408;&#x6210;&#x94FE;&#x8868;&#x3002;</p>
<p>Hashtable&#x91C7;&#x7528;&#x7684;&#x7B56;&#x7565;&#x662F;&#x9664;&#x6CD5;&#x6563;&#x5217;&#x6CD5;&#xFF0C;&#x800C;HashMap&#x5219;&#x901A;&#x8FC7;&#x6548;&#x7387;&#x66F4;&#x9AD8;&#x66F4;&#x5DE7;&#x5999;<code>hash &amp; (length-1)</code> &#x65B9;&#x6CD5;&#xFF0C;&#x540C;&#x6837;&#x5B9E;&#x73B0;&#x4E86;&#x5747;&#x5300;&#x7684;&#x6563;&#x5217;&#x3002;&#x5982;&#x4E0B;&#x4F8B;&#x5B50;&#xFF0C;</p>
<p>&#x5DE7;&#x5999;&#x4E4B;&#x5904;&#x5728;&#x4E8E;&#x4EE5;&#x4E0B;3&#x70B9;&#xFF1A;</p>
<p>1&#x3001;&#x7531;&#x4E8E;table&#x7684;&#x957F;&#x5EA6;length=2&#x7684;&#x6574;&#x6570;&#x6B21;&#x5E42;&#xFF0C;&#x786E;&#x4FDD;&#x4E86;<code>length - 1</code>&#x4E3A;&#x5947;&#x6570;&#xFF0C;&#x5947;&#x6570;&#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x6700;&#x540E;&#x4E00;&#x4F4D;&#x5C3E;&#x6570;&#x5FC5;&#x4E3A;1&#xFF0C;&#x6240;&#x4EE5;hash&#x6700;&#x540E;&#x4E00;&#x4F4D;&#x65E0;&#x8BBA;&#x662F;1&#x6216;&#x662F;0&#xFF0C;<strong>&#x4E0E;</strong>&#x8FD0;&#x7B97;&#x7ED3;&#x679C;&#x90FD;&#x4F1A;&#x4EA7;&#x751F;1&#x6216;0&#x7684;&#x7ED3;&#x679C;&#x3002;&#x53CD;&#x4E4B;&#xFF0C;&#x5982;&#x679C;Length&#x4E3A;&#x5076;&#x6570;&#xFF0C;&#x5C3E;&#x6570;&#x662F;0&#xFF0C;<strong>&#x4E0E;</strong>&#x8FD0;&#x7B97;&#x7ED3;&#x679C;&#x53EA;&#x53EF;&#x80FD;&#x662F;0&#x3002;&#x5BFC;&#x81F4;&#x6240;&#x6709;&#x4F4D;&#x7F6E;&#x7D22;&#x5F15;&#x7684;&#x8BA1;&#x7B97;&#x503C;&#x90FD;&#x53EA;&#x80FD;&#x662F;&#x5076;&#x6570;&#xFF0C;&#x6D6A;&#x8D39;&#x4E00;&#x534A;&#x7A7A;&#x95F4;&#x3002;</p>
<p>2&#x3001; &#x901A;&#x8FC7;<strong>&#x4E0E;</strong>&#x8FD0;&#x7B97;&#x7D22;&#x5F15;&#xFF0C;&#x4E00;&#x6B21;&#x8FD0;&#x7B97;&#x6548;&#x7387;&#x66F4;&#x9AD8;&#xFF0C;&#x800C;&#x4E14;&#x4FDD;&#x8BC1;&#x53D6;&#x6837;&#x6570;&#x636E;&#x5C0F;&#x4E8E;table&#x957F;&#x5EA6;&#xFF0C;&#x4F8B;&#x5982;&#xFF0C;&#x957F;&#x5EA6;&#x4E3A;16&#xFF08;10000&#xFF09;&#xFF0C;length - 1 = 15&#xFF08;1111&#xFF09;&#xFF1B;&#x6240;&#x6709;&#x4E0E;15&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#x7684;Hash&#xFF0C;&#x5B9E;&#x9645;&#x8FD0;&#x7B97;&#x90FD;&#x53EA;&#x6709;&#x540E;4&#x4F4D;&#xFF0C;&#x5FC5;&#x7136;&#x4E0D;&#x4F1A;&#x4EA7;&#x751F;&#x5927;&#x4E8E;15&#x7684;&#x503C;</p>
<pre><code>10001101 &amp; 1111 = 1101
10000101 &amp; 1111 = 101
</code></pre><pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">test</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-keyword">int</span> num = <span class="hljs-number">156546</span>;
    <span class="hljs-keyword">int</span> target = <span class="hljs-number">0</span>;

    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">1</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;11&#xFF1B;&#x5341;&#x8FDB;&#x5236;3</span>
    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">2</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;100&#xFF1B;&#x5341;&#x8FDB;&#x5236;4</span>
    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">3</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;101&#xFF1B;&#x5341;&#x8FDB;&#x5236;5</span>
    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">4</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;110&#xFF1B;&#x5341;&#x8FDB;&#x5236;6</span>
    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">5</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;111&#xFF1B;&#x5341;&#x8FDB;&#x5236;7</span>
    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">6</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;1000&#xFF1B;&#x5341;&#x8FDB;&#x5236;8</span>
    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">7</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;1001&#xFF1B;&#x5341;&#x8FDB;&#x5236;9</span>
    printInfo(target = <span class="hljs-number">15</span> &amp; (num + <span class="hljs-number">8</span>));<span class="hljs-comment">//&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;1010&#xFF1B;&#x5341;&#x8FDB;&#x5236;10</span>
}
</code></pre>
<h2 id="put--&#x63D2;&#x5165;&#x76EE;&#x6807;&#x5BF9;&#x8C61;">put()--&#x63D2;&#x5165;&#x76EE;&#x6807;&#x5BF9;&#x8C61;</h2>
<pre><code class="lang-java">
<span class="hljs-function"><span class="hljs-keyword">public</span> V <span class="hljs-title">put</span><span class="hljs-params">(K key, V value)</span> </span>{
    <span class="hljs-keyword">return</span> putVal(hash(key), key, value, <span class="hljs-keyword">false</span>, <span class="hljs-keyword">true</span>);
}

<span class="hljs-comment">//Map&#x63A5;&#x53E3;put()&#x65B9;&#x6CD5;&#x7684;&#x5177;&#x4F53;&#x5B9E;&#x73B0;</span>
<span class="hljs-function"><span class="hljs-keyword">final</span> V <span class="hljs-title">putVal</span><span class="hljs-params">(<span class="hljs-keyword">int</span> hash, K key, V value, <span class="hljs-keyword">boolean</span> onlyIfAbsent,
               <span class="hljs-keyword">boolean</span> evict)</span> </span>{
    Node&lt;K,V&gt;[] tab; Node&lt;K,V&gt; p; <span class="hljs-keyword">int</span> n, i;
    <span class="hljs-keyword">if</span> ((tab = table) == <span class="hljs-keyword">null</span> || (n = tab.length) == <span class="hljs-number">0</span>)
        n = (tab = resize()).length;
    <span class="hljs-comment">//table&#x7D22;&#x5F15;&#x4F4D;&#x7F6E;&#x65E0;&#x8282;&#x70B9;&#xFF0C;&#x521B;&#x5EFA;&#x65B0;&#x8282;&#x70B9;</span>
    <span class="hljs-keyword">if</span> ((p = tab[i = (n - <span class="hljs-number">1</span>) &amp; hash]) == <span class="hljs-keyword">null</span>)
        tab[i] = newNode(hash, key, value, <span class="hljs-keyword">null</span>);
     <span class="hljs-comment">//&#x53CD;&#x4E4B;&#xFF0C;&#x6709;&#x8282;&#x70B9;</span>
    <span class="hljs-keyword">else</span> {
        Node&lt;K,V&gt; e; K k;
        <span class="hljs-comment">//&#x9A8C;&#x8BC1;&#x9996;&#x8282;&#x70B9;&#xFF08;&#x94FE;&#x8868;&#xFF09;&#x76F8;&#x7B49;&#x5373;&#x76F4;&#x63A5;&#x8D4B;&#x503C;</span>
        <span class="hljs-keyword">if</span> (p.hash == hash &amp;&amp;
            ((k = p.key) == key || (key != <span class="hljs-keyword">null</span> &amp;&amp; key.equals(k))))
            e = p;
        <span class="hljs-comment">//&#x9A8C;&#x8BC1;&#x9996;&#x8282;&#x70B9;&#x4E3A;&#x6811;&#x8282;&#x70B9;&#xFF08;&#x7EA2;&#x9ED1;&#x6811;&#xFF09;&#x5373;&#x6267;&#x884C;&#x6811;&#x8282;&#x70B9;&#x6DFB;&#x52A0;&#x65B9;&#x6CD5;putTreeVal()&#x3002;&#x540E;&#x7EED;&#x4F1A;&#x6709;&#x5206;&#x6790;</span>
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (p <span class="hljs-keyword">instanceof</span> TreeNode)
            e = ((TreeNode&lt;K,V&gt;)p).putTreeVal(<span class="hljs-keyword">this</span>, tab, hash, key, value);

        <span class="hljs-comment">//TREEIFY_THRESHOLD : &#x94FE;&#x8868;&#x8F6C;&#x6362;&#x7EA2;&#x9ED1;&#x6811;&#x7684;&#x9608;&#x503C;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;8&#xFF0C;&#x5F53;&#x94FE;&#x8868;&#x6DF1;&#x5EA6;&#x5927;&#x4E8E;8&#x65F6;&#xFF0C;treeifyBin()&#x8F6C;&#x6362;</span>
        <span class="hljs-keyword">else</span> {
            <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> binCount = <span class="hljs-number">0</span>; ; ++binCount) {
                <span class="hljs-keyword">if</span> ((e = p.next) == <span class="hljs-keyword">null</span>) {
                    p.next = newNode(hash, key, value, <span class="hljs-keyword">null</span>);
                    <span class="hljs-keyword">if</span> (binCount &gt;= TREEIFY_THRESHOLD - <span class="hljs-number">1</span>) <span class="hljs-comment">// -1 for 1st</span>
                        treeifyBin(tab, hash);
                    <span class="hljs-keyword">break</span>;
                }

                <span class="hljs-comment">//&#x5F53;&#x94FE;&#x8868;&#x5305;&#x542B;&#x76F8;&#x540C;&#x7684;Key&#xFF0C;&#x5219;&#x66F4;&#x65B0;&#x8282;&#x70B9;</span>
                <span class="hljs-keyword">if</span> (e.hash == hash &amp;&amp;
                    ((k = e.key) == key || (key != <span class="hljs-keyword">null</span> &amp;&amp; key.equals(k))))
                    <span class="hljs-keyword">break</span>;
                p = e;
            }
        }
        <span class="hljs-keyword">if</span> (e != <span class="hljs-keyword">null</span>) { <span class="hljs-comment">// existing mapping for key</span>
            V oldValue = e.value;
            <span class="hljs-keyword">if</span> (!onlyIfAbsent || oldValue == <span class="hljs-keyword">null</span>)
                e.value = value;
            afterNodeAccess(e);
            <span class="hljs-keyword">return</span> oldValue;
        }
    }
    ++modCount;
    <span class="hljs-comment">//&#x91CD;&#x8981;&#xFF1A;&#x5F53;HashMap&#x7684;&#x5BB9;&#x91CF;&#x5927;&#x4E8E;&#x6570;&#x7EC4;table&#x7684;&#x9608;&#x503C;&#x65F6;&#xFF0C;&#x5BF9;&#x6570;&#x7EC4;&#x8FDB;&#x884C;&#x6269;&#x5BB9;&#xFF0C;&#x53C2;&#x8003;resize()&#x8BF4;&#x660E;&#x3002;</span>
    <span class="hljs-keyword">if</span> (++size &gt; threshold)
        resize();
    afterNodeInsertion(evict);
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
}
</code></pre>
<h2 id="get--&#x83B7;&#x53D6;&#x76EE;&#x6807;&#x5BF9;&#x8C61;">get()--&#x83B7;&#x53D6;&#x76EE;&#x6807;&#x5BF9;&#x8C61;</h2>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> V <span class="hljs-title">get</span><span class="hljs-params">(Object key)</span> </span>{
    Node&lt;k,v&gt; e;
    <span class="hljs-keyword">return</span> (e = getNode(hash(key), key)) == <span class="hljs-keyword">null</span> ? <span class="hljs-keyword">null</span> : e.value;
}

<span class="hljs-comment">//Map&#x63A5;&#x53E3;get()&#x65B9;&#x6CD5;&#x7684;&#x5177;&#x4F53;&#x5B9E;&#x73B0;</span>
<span class="hljs-function"><span class="hljs-keyword">final</span> Node&lt;K,V&gt; <span class="hljs-title">getNode</span><span class="hljs-params">(<span class="hljs-keyword">int</span> hash, Object key)</span> </span>{
    Node&lt;K,V&gt;[] tab; Node&lt;K,V&gt; first, e; <span class="hljs-keyword">int</span> n; K k;

    <span class="hljs-comment">//&#x901A;&#x8FC7;hash&#x503C;&#x8BA1;&#x7B97;table&#x4F4D;&#x7F6E;&#x7D22;&#x5F15;&#xFF08;&#x4EE5;&#x4E0A;&#x6709;&#x5206;&#x6790; &#xFF09;&#xFF0C;&#x83B7;&#x5F97;table&#x4E0A;&#x5BF9;&#x5E94;&#x4F4D;&#x7F6E;&#x7684;&#x9996;&#x4E2A;&#x94FE;&#x8868;Node</span>
    <span class="hljs-keyword">if</span> ((tab = table) != <span class="hljs-keyword">null</span> &amp;&amp; (n = tab.length) &gt; <span class="hljs-number">0</span> &amp;&amp;
        (first = tab[(n - <span class="hljs-number">1</span>) &amp; hash]) != <span class="hljs-keyword">null</span>) { 
        <span class="hljs-comment">//&#x5927;&#x725B;&#x6CE8;&#x91CA;&#xFF1A;always check first node&#xFF0C;&#x9996;&#x4E2A;Node&#x76F4;&#x63A5;&#x9A8C;&#x8BC1;hash&#xFF0C;&#x5728;&#x6570;&#x636E;&#x91CF;&#x8F83;&#x5C11;&#x60C5;&#x51B5;&#x4E0B;&#x63D0;&#x9AD8;&#x6027;&#x80FD;</span>
        <span class="hljs-comment">//hash&#x76F8;&#x7B49;&#xFF0C;&#x4E14;key&#xFF0C;bingo&#xFF0C;&#x627E;&#x5BF9;&#x76EE;&#x6807;Node</span>
        <span class="hljs-keyword">if</span> (first.hash == hash &amp;&amp; <span class="hljs-comment">// always check first node</span>
            ((k = first.key) == key || (key != <span class="hljs-keyword">null</span> &amp;&amp; key.equals(k))))
            <span class="hljs-keyword">return</span> first;

        <span class="hljs-comment">//&#x904D;&#x5386;&#x94FE;&#x8868;&#xFF0C;&#x76F4;&#x81F3;&#x627E;&#x5230;&#x94FE;&#x8868;&#x6700;&#x540E;&#x4E00;&#x4E2A;Node&#x8282;&#x70B9;</span>
        <span class="hljs-keyword">if</span> ((e = first.next) != <span class="hljs-keyword">null</span>) {
            <span class="hljs-keyword">if</span> (first <span class="hljs-keyword">instanceof</span> TreeNode)
                <span class="hljs-keyword">return</span> ((TreeNode&lt;K,V&gt;)first).getTreeNode(hash, key);
            do {
                <span class="hljs-keyword">if</span> (e.hash == hash &amp;&amp;
                    ((k = e.key) == key || (key != <span class="hljs-keyword">null</span> &amp;&amp; key.equals(k))))
                    <span class="hljs-keyword">return</span> e;
            } <span class="hljs-keyword">while</span> ((e = e.next) != <span class="hljs-keyword">null</span>);
        }
    }
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
}
</code></pre>
<p>1&#x3001;&#x5224;&#x65AD;&#x662F;&#x5426;&#x76EE;&#x6807;&#x8282;&#x70B9;&#x7684;&#x4EE3;&#x7801;&#x662F;&#xFF1A;&#x8981;&#x6C42;&#x8282;&#x70B9;&#x7684;hash&#x503C;&#x4E00;&#x81F4;&#xFF0C;&#x8FD9;&#x4E00;&#x70B9;&#x6BEB;&#x65E0;&#x7591;&#x95EE;&#xFF1B;&#x901A;&#x8FC7;==&#x6216;equal()&#x65B9;&#x6CD5;&#x4E24;&#x6B21;&#x5224;&#x65AD;&#x76F8;&#x7B49;&#x7684;&#x539F;&#x56E0;&#xFF0C;&#x539F;&#x56E0;&#x662F;&#x4E0D;&#x662F;&#x6240;&#x6709;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x90FD;&#x80FD;&#x901A;&#x8FC7;==&#x5224;&#x65AD;&#x76F8;&#x7B49;&#xFF1B;&#x4F8B;&#x5982;string&#xFF0C;new String(&quot;abc&quot;)&#x4E0E;&quot;abc&quot;&#x5206;&#x522B;&#x6307;&#x5411;&#x4E0D;&#x540C;&#x5185;&#x5B58;&#x533A;&#x57DF;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x662F;&#x4E0D;&#x76F8;&#x7B49;&#x7684;&#x3002;&#x800C;equals()&#x65B9;&#x6CD5;&#x662F;&#x5C06;&#x53C2;&#x6570;&#xFF0C;&#x5F3A;&#x8F6C;&#x6210;string&#xFF0C;&#x518D;&#x8F6C;&#x6362;&#x4E3A;char[]&#xFF0C;&#x7136;&#x540E;&#x8FED;&#x4EE3;&#xFF0C;&#x9010;&#x4E2A;char&#x8FDB;&#x884C;&#x6BD4;&#x8F83;&#xFF0C;&#x56E0;&#x6B64;&#x662F;&#x4E24;&#x4E2A;string&#x7684;&#x503C;&#x4E4B;&#x95F4;&#x7684;&#x6BD4;&#x8F83;</p>
<pre><code class="lang-java"><span class="hljs-keyword">if</span> (e.hash == hash &amp;&amp;
    ((k = e.key) == key || (key != <span class="hljs-keyword">null</span> &amp;&amp; key.equals(k))))
{}
</code></pre>
<p>2&#x3001;&#x904D;&#x5386;&#x94FE;&#x8868;&#xFF0C;&#x52A0;&#x8F7D;&#x94FE;&#x8868;&#x9996;&#x90E8;&#x8282;&#x70B9;&#x6C38;&#x8FDC;&#x4F18;&#x5148;&#x4E8E;&#x5C3E;&#x90E8;&#x8282;&#x70B9;&#x3002;</p>
<h2 id="resize--&#x6570;&#x7EC4;&#x6269;&#x5BB9;">resize()--&#x6570;&#x7EC4;&#x6269;&#x5BB9;</h2>
<pre><code class="lang-java"><span class="hljs-keyword">final</span> Node&lt;K,V&gt;[] resize() {
    Node&lt;K,V&gt;[] oldTab = table;
    <span class="hljs-keyword">int</span> oldCap = (oldTab == <span class="hljs-keyword">null</span>) ? <span class="hljs-number">0</span> : oldTab.length;
    <span class="hljs-comment">//oldThr&#xFF1A;&#x65E7;&#x6570;&#x7EC4;&#x5B9E;&#x9645;&#x5BB9;&#x91CF; = &#x957F;&#x5EA6; * &#x6269;&#x5C55;&#x56E0;&#x5B50;0.75</span>
    <span class="hljs-keyword">int</span> oldThr = threshold;
    <span class="hljs-keyword">int</span> newCap, newThr = <span class="hljs-number">0</span>;
    <span class="hljs-comment">//oldCap&#xFF1A;&#x65E7;&#x6570;&#x7EC4;&#x957F;&#x5EA6;</span>
    <span class="hljs-keyword">if</span> (oldCap &gt; <span class="hljs-number">0</span>) {
        <span class="hljs-keyword">if</span> (oldCap &gt;= MAXIMUM_CAPACITY) {
            threshold = Integer.MAX_VALUE;
            <span class="hljs-keyword">return</span> oldTab;
        }
        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> ((newCap = oldCap &lt;&lt; <span class="hljs-number">1</span>) &lt; MAXIMUM_CAPACITY &amp;&amp; oldCap &gt;= DEFAULT_INITIAL_CAPACITY)
            newThr = oldThr &lt;&lt; <span class="hljs-number">1</span>; <span class="hljs-comment">// &#x5B9E;&#x9645;&#x5BB9;&#x91CF;&#x6269;&#x5145;&#x4E00;&#x500D;</span>
    }
    <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (oldThr &gt; <span class="hljs-number">0</span>) <span class="hljs-comment">// initial capacity was placed in threshold</span>
        newCap = oldThr;
    <span class="hljs-keyword">else</span> {               <span class="hljs-comment">// zero initial threshold signifies using defaults</span>
        newCap = DEFAULT_INITIAL_CAPACITY;
        newThr = (<span class="hljs-keyword">int</span>)(DEFAULT_LOAD_FACTOR * DEFAULT_INITIAL_CAPACITY);
    }
    <span class="hljs-comment">//&#x6570;&#x7EC4;&#x5B9E;&#x9645;&#x5BB9;&#x91CF;&#x4E3A;0&#x65F6;&#xFF0C;&#x521D;&#x59CB;&#x5316;&#xFF1A;newThr = &#x957F;&#x5EA6; * &#x6269;&#x5C55;&#x56E0;&#x5B50;0.75</span>
    <span class="hljs-keyword">if</span> (newThr == <span class="hljs-number">0</span>) {
        <span class="hljs-keyword">float</span> ft = (<span class="hljs-keyword">float</span>)newCap * loadFactor;
        newThr = (newCap &lt; MAXIMUM_CAPACITY &amp;&amp; ft &lt; (<span class="hljs-keyword">float</span>)MAXIMUM_CAPACITY ?
                    (<span class="hljs-keyword">int</span>)ft : Integer.MAX_VALUE);
    }
    threshold = newThr;
    <span class="hljs-meta">@SuppressWarnings</span>({<span class="hljs-string">&quot;rawtypes&quot;</span>,<span class="hljs-string">&quot;unchecked&quot;</span>})
        Node&lt;K,V&gt;[] newTab = (Node&lt;K,V&gt;[])<span class="hljs-keyword">new</span> Node[newCap];
    table = newTab;
    <span class="hljs-keyword">if</span> (oldTab != <span class="hljs-keyword">null</span>) {
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> j = <span class="hljs-number">0</span>; j &lt; oldCap; ++j) {
            Node&lt;K,V&gt; e;
            <span class="hljs-keyword">if</span> ((e = oldTab[j]) != <span class="hljs-keyword">null</span>) {
                oldTab[j] = <span class="hljs-keyword">null</span>;
                <span class="hljs-keyword">if</span> (e.next == <span class="hljs-keyword">null</span>)
                    newTab[e.hash &amp; (newCap - <span class="hljs-number">1</span>)] = e;
                <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (e <span class="hljs-keyword">instanceof</span> TreeNode)
                    ((TreeNode&lt;K,V&gt;)e).split(<span class="hljs-keyword">this</span>, newTab, j, oldCap);
                <span class="hljs-keyword">else</span> { <span class="hljs-comment">// preserve order</span>
                    Node&lt;K,V&gt; loHead = <span class="hljs-keyword">null</span>, loTail = <span class="hljs-keyword">null</span>;
                    Node&lt;K,V&gt; hiHead = <span class="hljs-keyword">null</span>, hiTail = <span class="hljs-keyword">null</span>;
                    Node&lt;K,V&gt; next;
                    do {
                        next = e.next;
                        <span class="hljs-keyword">if</span> ((e.hash &amp; oldCap) == <span class="hljs-number">0</span>) {
                            <span class="hljs-keyword">if</span> (loTail == <span class="hljs-keyword">null</span>)
                                loHead = e;
                            <span class="hljs-keyword">else</span>
                                loTail.next = e;
                            loTail = e;
                        }
                        <span class="hljs-keyword">else</span> {
                            <span class="hljs-keyword">if</span> (hiTail == <span class="hljs-keyword">null</span>)
                                hiHead = e;
                            <span class="hljs-keyword">else</span>
                                hiTail.next = e;
                            hiTail = e;
                        }
                    } <span class="hljs-keyword">while</span> ((e = next) != <span class="hljs-keyword">null</span>);
                    <span class="hljs-keyword">if</span> (loTail != <span class="hljs-keyword">null</span>) {
                        loTail.next = <span class="hljs-keyword">null</span>;
                        newTab[j] = loHead;
                    }
                    <span class="hljs-keyword">if</span> (hiTail != <span class="hljs-keyword">null</span>) {
                        hiTail.next = <span class="hljs-keyword">null</span>;
                        newTab[j + oldCap] = hiHead;
                    }
                }
            }
        }
    }
    <span class="hljs-keyword">return</span> newTab;
}
</code></pre>
<p>1&#x3001;&#x6269;&#x5BB9;&#x7684;&#x65F6;&#x673A;&#xFF1A;resize()&#x65B9;&#x6CD5;&#x5728;putVal()&#x65B9;&#x6CD5;&#x4E2D;&#x8C03;&#x7528;&#xFF0C;&#x6BCF;&#x6B21;&#x5F80;HashMap&#x4E2D;&#x6DFB;&#x52A0;&#x65B0;&#x7684;&#x5BF9;&#x8C61;&#xFF08;&#x6CE8;&#x610F;&#x662F;size&#x662F;&#x6574;&#x4E2A;HashMap&#x7684;&#x5927;&#x5C0F;&#xFF0C;&#x975E;&#x6570;&#x7EC4;&#x957F;&#x5EA6;&#xFF0C;&#x4EA6;&#x975E;&#x94FE;&#x8868;&#x6216;&#x7EA2;&#x9ED1;&#x6811;&#x7684;&#x6DF1;&#x5EA6;&#xFF09;&#xFF0C;HashMap&#x7684;&#x6570;&#x636E;&#x91CF;&#x5927;&#x4E8E;&#x6269;&#x5BB9;&#x9608;&#x503C;<strong>threshold</strong>&#x65F6;&#xFF0C;&#x5BF9;table&#x8FDB;&#x884C;&#x6269;&#x5BB9;&#x3002;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#xFF0C;&#x6269;&#x5BB9;&#x9608;&#x503C;&#xFF1A;<code>threshold = 12 = 16(table&#x957F;&#x5EA6;&#x9608;&#x503C;) * 0.75(&#x6269;&#x5145;&#x56E0;&#x5B50;)</code>&#xFF0C;</p>
<pre><code class="lang-java"><span class="hljs-keyword">if</span> (++size &gt; threshold)
    resize();
</code></pre>
<p>2&#x3001;&#x6269;&#x5BB9;&#x7684;&#x672C;&#x8D28;&#xFF1A;&#x8BA1;&#x7B97;&#x65B0;&#x7684;&#x5BB9;&#x91CF;&#x503C;&#xFF0C;&#x521B;&#x5EFA;&#x65B0;&#x6570;&#x7EC4;&#xFF0C;&#x91CD;&#x65B0;&#x8BA1;&#x7B97;&#x539F;&#x6570;&#x7EC4;&#x7684;&#x5404;&#x4E2A;&#x94FE;&#x8868;&#xFF08;&#x7EA2;&#x9ED1;&#x6811;&#xFF09;&#x7684;&#x65B0;&#x4F4D;&#x7F6E;&#xFF0C;&#x62F7;&#x8D1D;&#x81F3;&#x65B0;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="lang-java">Node&lt;K,V&gt;[] newTab = (Node&lt;K,V&gt;[])<span class="hljs-keyword">new</span> Node[newCap];
</code></pre>
<p>3&#x3001;&#x6269;&#x5BB9;&#x9608;&#x503C;<strong>threshold</strong>&#xFF1A;HashMap&#x7684;&#x6570;&#x636E;&#x91CF;&#x5927;&#x4E8E;&#x6269;&#x5BB9;&#x6B64;&#x503C;&#x65F6;&#xFF0C;&#x5BF9;table&#x8FDB;&#x884C;&#x6269;&#x5BB9;&#xFF1B;
&#x586B;&#x5145;&#x56E0;&#x5B50;<strong>loadFactor</strong>&#xFF1A;<code>threshold = table.length * loadFactor</code>;
&#x4F8B;&#x5982;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#xFF1A;table&#x9ED8;&#x8BA4;&#x957F;&#x5EA6;&#x4E3A;16&#xFF0C;loadFactor&#x9ED8;&#x8BA4;&#x4E3A;0.75&#xFF0C;&#x56E0;&#x6B64;&#xFF0C;<code>threshold = 16 * 0.75 = table.length * loadFactor</code> 12&#x3002;&#x6839;&#x636E;&#x7B2C;1&#x70B9;&#xFF0C;&#x5373;table&#x6709;16&#x4E2A;&#x4F4D;&#x7F6E;&#xFF0C;&#x672C;&#x4E2A;HashMap&#x6700;&#x591A;&#x4E5F;&#x80FD;&#x5BB9;&#x7EB3;12&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x8D85;&#x51FA;&#x5219;&#x9700;&#x8981;&#x6269;&#x5BB9;table&#x3002;</p>
<blockquote>
<p>&#x5F53;12&#x4E2A;&#x5BF9;&#x8C61;Hash&#x4F4D;&#x7F6E;&#x5168;&#x90E8;&#x4E0D;&#x540C;&#x65F6;&#xFF0C;&#x8FBE;&#x5230;&#x8BE5;loadFactor&#x4E0B;&#x6700;&#x4F73;&#x7A7A;&#x95F4;&#x5229;&#x7528;&#x7387;&#xFF1A;
&#x3010;a&#x3011;&#x3010;b&#x3011;&#x3010;c&#x3011;&#x3010;d&#x3011;&#x3010;e&#x3011;&#x3010;f&#x3011;&#x3010;g&#x3011;&#x3010;h&#x3011;&#x3010;i&#x3011;&#x3010;j&#x3011;&#x3010;k&#x3011;&#x3010;l&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;
&#x53CD;&#x4E4B;&#xFF1A; 
&#x3010;a-b&#x3011;&#x3010;c-d-e&#x3011;&#x3010;f-g-h-i&#x3011;&#x3010;j&#x3011;&#x3010;k-l&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;&#x3010;&#x3011;</p>
</blockquote>
<hr>
<blockquote>
<p> &#x5F53;loadFactor&#x586B;&#x5145;&#x56E0;&#x5B50;&#x8D8A;&#x5927;&#xFF0C;table&#x586B;&#x6EE1;&#x7A0B;&#x5EA6;&#x8D8A;&#x9AD8;&#xFF1A;&#x5047;&#x8BBE;&#x4EE5;&#x4E0B;&#x4F8B;&#x5B50;&#x5168;&#x90E8;&#x8FBE;&#x5230;&#x6700;&#x4F73;&#x7A7A;&#x95F4;&#x5229;&#x7528;&#x7387;
 1&#xFF1A;&#x3010;a&#x3011;&#x3010;b&#x3011;&#x3010;c&#x3011;&#x3010;d&#x3011;&#x3010;e&#x3011;&#x3010;f&#x3011;&#x3010;g&#x3011;&#x3010;h&#x3011;&#x3010;i&#x3011;&#x3010;j&#x3011;&#x3010;k&#x3011;&#x3010;l&#x3011;&#x3010;m&#x3011;&#x3010;o&#x3011;&#x3010;p&#x3011;&#x3010;q&#x3011;
 0.75&#xFF1A;&#x3010;a&#x3011;&#x3010;b&#x3011;&#x3010;c&#x3011;&#x3010;d&#x3011;&#x3010;e&#x3011;&#x3010;f&#x3011;&#x3010;g&#x3011;&#x3010;h&#x3011;&#x3010;i&#x3011;&#x3010;j&#x3011;&#x3010;k&#x3011;&#x3010;l&#x3011;&#x3010; &#x3011;&#x3010; &#x3011;&#x3010; &#x3011;&#x3010; &#x3011;</p>
</blockquote>
<p>4&#x3001;&#x6269;&#x5BB9;&#x65B9;&#x5F0F;&#xFF1A;table&#x957F;&#x5EA6;&#x4E0E;&#x6269;&#x5BB9;&#x9608;&#x503C;&#x5206;&#x522B;&#x589E;&#x5927;&#x4E00;&#x500D;&#xFF0C;&#x5176;&#x7ED3;&#x679C;&#x5FC5;&#x987B;&#x4E3A;2&#x7684;&#x5E42;&#x3002;</p>
<pre><code class="lang-java">newCap = oldCap &lt;&lt; <span class="hljs-number">1</span>;
newThr = oldThr &lt;&lt; <span class="hljs-number">1</span>;
</code></pre>
<p>5&#x3001;&#x7A7A;&#x95F4;&#x4E0E;&#x6027;&#x80FD;&#x7684;&#x5E73;&#x8861;&#xFF1A;&#x5176;&#x5B9E;&#x662F;&#x7A7A;&#x95F4;&#x5229;&#x7528;&#x7387;&#x4E0E;&#x51B2;&#x7A81;&#x673A;&#x4F1A;&#x7684;&#x5E73;&#x8861;&#x3002;</p>
<p>&#x5047;&#x8BBE;<strong>loadFactor</strong>&#x4E3A;1&#xFF0C;&#x7A7A;&#x95F4;&#x5229;&#x7528;&#x7387;100%&#xFF0C;16&#x4E2A;&#x4F4D;&#x7F6E;&#x6446;&#x653E;&#x7684;16&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x901A;&#x8FC7;&#x7B97;&#x6CD5;<code>(16 - 1) &amp; hash</code>&#x83B7;&#x5F97;&#x7684;&#x4E0B;&#x6807;&#x8303;&#x56F4;&#x5FC5;&#x7136;&#x662F;<code>[0, 15]</code>&#xFF0C;&#x82E5;<strong>loadFactor</strong>&#x4E3A;0.75&#xFF0C;&#x901A;&#x8FC7;<code>(31 - 1) &amp; hash</code>&#x8BA1;&#x7B97;&#xFF0C;16&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x4E0B;&#x6807;&#x8303;&#x56F4;&#x5219;&#x662F;<code>[0, 31]</code>&#x3002;&#x76F8;&#x6BD4;&#x4E8E;&#x6709;31&#x4E2A;&#x4F4D;&#x7F6E;&#x53EF;&#x4EE5;&#x6446;&#x653E;&#xFF0C;&#x53EA;&#x6709;16&#x4E2A;&#x4F4D;&#x7F6E;&#x7684;&#x51B2;&#x7A81;&#x673A;&#x4F1A;&#x5FC5;&#x7136;&#x66F4;&#x5927;&#x3002;</p>
<p>&#x7136;&#x800C;&#xFF0C;&#x51B2;&#x7A81;&#x673A;&#x4F1A;&#x8D8A;&#x5927;&#xFF0C;&#x610F;&#x5473;&#x7740;&#x67E5;&#x8BE2;&#x63D2;&#x5165;&#x65F6;&#x8981;&#x904D;&#x5386;&#x5355;&#x4E2A;&#x4F4D;&#x7F6E;&#x4E0A;&#x94FE;&#x8868;&#x7684;&#x53EF;&#x80FD;&#x8D8A;&#x9AD8;&#xFF0C;&#x6027;&#x80FD;&#x8D8A;&#x4F4E;&#x3002;
&#x7ED3;&#x8BBA;&#xFF1A;<strong>loadFactor</strong>&#x8D8A;&#x5927;&#xFF0C;&#x7A7A;&#x95F4;&#x5229;&#x7528;&#x7387;&#x8D8A;&#x9AD8;&#xFF1B;&#x8D8A;&#x5C0F;&#xFF0C;&#x5219;&#x67E5;&#x8BE2;&#x6027;&#x80FD;&#x8D8A;&#x9AD8;&#xFF1B;</p>
<p>&#x5982;&#x679C;&#x673A;&#x5668;&#x5185;&#x5B58;&#x8DB3;&#x591F;&#xFF0C;&#x5E76;&#x4E14;&#x60F3;&#x8981;&#x63D0;&#x9AD8;&#x67E5;&#x8BE2;&#x901F;&#x5EA6;&#x7684;&#x8BDD;&#x53EF;&#x4EE5;&#x5C06;&#x52A0;&#x8F7D;&#x56E0;&#x5B50;&#x8BBE;&#x7F6E;&#x5C0F;&#x4E00;&#x70B9;&#xFF1B;&#x76F8;&#x53CD;&#x5982;&#x679C;&#x673A;&#x5668;&#x5185;&#x5B58;&#x7D27;&#x5F20;&#xFF0C;&#x5E76;&#x4E14;&#x5BF9;&#x67E5;&#x8BE2;&#x901F;&#x5EA6;&#x6CA1;&#x6709;&#x4EC0;&#x4E48;&#x8981;&#x6C42;&#x7684;&#x8BDD;&#x53EF;&#x4EE5;&#x5C06;&#x52A0;&#x8F7D;&#x56E0;&#x5B50;&#x8BBE;&#x7F6E;&#x5927;&#x4E00;&#x70B9;&#x3002;&#x4E0D;&#x8FC7;&#x4E00;&#x822C;&#x6211;&#x4EEC;&#x90FD;&#x4E0D;&#x7528;&#x53BB;&#x8BBE;&#x7F6E;&#x5B83;&#xFF0C;&#x8BA9;&#x5B83;&#x53D6;&#x9ED8;&#x8BA4;&#x503C;0.75&#x5C31;&#x597D;
&#x4E86;&#x3002;</p>
<h2 id="&#x5B9E;&#x73B0;&#x6700;&#x5C11;&#x4F7F;&#x7528;cache">&#x5B9E;&#x73B0;&#x6700;&#x5C11;&#x4F7F;&#x7528;cache</h2>
<p>&#x5F85;</p>
<p>&#x53C2;&#x8003;&#x535A;&#x6587;&#xFF1A;</p>
<p>&#x4F4D;&#x8FD0;&#x7B97;&#x535A;&#x6587;&#xFF1A;<a href="http://blog.csdn.net/is_zhoufeng/article/details/8112199" target="_blank">http://blog.csdn.net/is_zhoufeng/article/details/8112199</a></p>
<p>hashMap&#x6E90;&#x7801;&#x5206;&#x6790;&#xFF1A;<a href="http://www.cnblogs.com/ITtangtang/p/3948406.html" target="_blank">http://www.cnblogs.com/ITtangtang/p/3948406.html</a></p>
<p>hash()&#x8BA1;&#x7B97;&#x539F;&#x7406;&#x5206;&#x6790;&#xFF1A;<a href="http://blog.csdn.net/huzhigenlaohu/article/details/51802457" target="_blank">http://blog.csdn.net/huzhigenlaohu/article/details/51802457</a></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; tgor.top 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2020-04-23 15:32:53
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="ArrayList源码分析.html" class="navigation navigation-prev " aria-label="Previous page: JDK源码分析ArrayList">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Java注解.html" class="navigation navigation-next " aria-label="Next page: Java注解">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"JDK源码分析HashMap","level":"1.10.6","depth":2,"next":{"title":"Java注解","level":"1.10.7","depth":2,"path":"Java-Base/Java注解.md","ref":"Java-Base/Java注解.md","articles":[]},"previous":{"title":"JDK源码分析ArrayList","level":"1.10.5","depth":2,"path":"Java-Base/ArrayList源码分析.md","ref":"Java-Base/ArrayList源码分析.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","splitter","tbfed-pagefooter","page-toc-button","-search","search-pro","popup","back-to-top-button","code","copy-code-button"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy tgor.top 2019","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"splitter":{},"search-pro":{"cutWordLib":"nodejieba","defineWord":["Gitbook Use"]},"popup":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":true},"fontsettings":{"theme":"sepia","family":"serif","size":1},"highlight":{},"page-toc-button":{"maxTocDepth":2,"minTocSize":2},"back-to-top-button":{},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"tgor","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"tgor note","gitbook":"*","description":"tgor生活工作记录"},"file":{"path":"Java-Base/HashMap源码分析.md","mtime":"2020-04-23T07:32:53.266Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-04-29T08:43:24.127Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

